<template>
    <div>
        <div class="blog-up">
            <p class="blog-up-name">测试标签去重</p>
        </div>
        <div class="show-content">
            <div class="show-left">
                <h3><span>文章目录</span><i class="el-icon-close"></i></h3>
                <ul>
                    <li class="star"><i class="el-icon-star-off"></i>&nbsp;&nbsp;<a href="#first">测试标签去重</a></li>
                    <li class="liststar"><i class="el-icon-star-on"></i>&nbsp;&nbsp;<a href="#inform">文章的schema</a></li>
                    <li class="liststar"><i class="el-icon-star-on"></i>&nbsp;&nbsp;<a href="#like">标签去重</a></li>
                </ul>

               
            </div>
            <div class="show-right">
                <h1>测试标签去重</h1>
                <div class="times"><i class="el-icon-time">2020年9月25日</i><i class="el-icon-chat-dot-round" style="margin-left: 30px;">0</i></div>
                <div class="finishs">
                    <h3><a name="first">测试标签去重</a></h3>
                </div>
                <div class="processs">
                    <h3><a name="inform">文章的schema</a></h3>
                    <pre><code class="lang-js"><span class="hljs-string">const</span> <span class="hljs-string">ArticleSchema</span> <span class="hljs-string">=</span> <span class="hljs-string">new</span> <span class="hljs-string">Schema(</span>
    <span class="hljs-string">{</span>
        <span class="hljs-attr">aid:</span> <span class="hljs-string">{</span> <span class="hljs-attr">type :</span> <span class="hljs-string">Number,</span> <span class="hljs-attr">index:</span> <span class="hljs-string">{</span> <span class="hljs-attr">unique:</span> <span class="hljs-literal">true</span> <span class="hljs-string">}</span> <span class="hljs-string">},</span>
        <span class="hljs-attr">title:</span> <span class="hljs-string">String,</span>
        <span class="hljs-attr">content:</span> <span class="hljs-string">String,</span>
        <span class="hljs-attr">tags:</span> <span class="hljs-string">[String],</span>
        <span class="hljs-attr">date:</span> <span class="hljs-string">Date,</span>
        <span class="hljs-attr">isPublish:</span> <span class="hljs-string">Boolean,</span>
        <span class="hljs-attr">comment_n:</span> <span class="hljs-string">Number</span>
    <span class="hljs-string">},</span>
    <span class="hljs-string">{</span> <span class="hljs-attr">versionKey:</span> <span class="hljs-literal">false</span> <span class="hljs-string">}</span>
<span class="hljs-string">)</span>
</code></pre>
                </div>
                <div class="processs">
                    <h3><a name="like">标签去重</a></h3>
                    <p>主要是使用了mongodb里面的distinct方法，就可以方便把文章schema里的tags合并</p>
                </div>
                <div>
                    <Email></Email>
                </div>
            </div>
        </div>
        
    </div>
</template>

<script>
import Email from '@/components/email'

export default {
    name:'show',
    components:{
        Email,
    }

}
</script>

<style scoped>
    *{
        margin: 0;
        padding: 0;
    }
    a{
        text-decoration: none;
        color: #fff;
    }

    .blog-up{
        background:url('../assets/sunset.jpg');
        height:570px;
        width:100%;
        background-size: 100% 100%;
        display: flex;
        align-items: center;
        justify-content: center;
    }
    .blog-up-name{
        margin: 0;
        color: #fff;
        font-size: 45px;
        font-family: 'Times New Roman';
    }
    .show-content{
        display: flex;
        background-color: black;
        color: #fff;
    }
    .show-left{
        width: 300px;
        text-align: left;
        margin-left: 32px;
        margin: 40px 20px 20px 10px;
    }
    .show-left h3 span{
        margin-right: 20px;
    }
    .show-left ul{
        color: #fff;
        list-style: none;
    }
    .show-left ul li{
        height: 30px;
        width: 190px;
    }
    .show-left h3{
        margin-bottom: 10px;
    }
    .star{
        margin-left:10px;
    }
    .liststar{
        margin-left: 30px;
        margin-top: 5px;
    }
    .show-right{
        width: 800px;
        text-align: left;
    }
    .show-right h1{
        text-align: center;
        margin-top: 70px;
    }
    .times{
        text-align: right;
    }
    .firsts{
        font-size: 25px;
        font-weight: 600;
        border-bottom: 2px solid #fff;
        padding: 20px 0 10px 0;
    }
    .codes{
        margin: 35px 0px 35px 0;
    }
    .codes p{
        margin-top: 10px;
        color: #e3eaf1;
    }
    .processs{

    }
    .processs h3{
        padding: 30px 0 10px 0;
    }
    .finishs{

    }
    .finishs h3{
        border-bottom: 2px solid;
        padding: 50px 0 15px 0;
    }
    .finishs p{
        padding-top: 25px;
    }
    pre{
        padding: 0.625rem 0.625rem;
        background: #474949;
        border-radius: 0.3125rem;
        overflow-x: auto;
        font-size: 18px;
        margin-top: 20px;
    }
    code{
        color: #93f0d8;
    }
    .hljs-comment{
        color: #8e908c;
    }
    .hljs-tag{
        color: darkturquoise;
    }
    .hljs-string{
        color: greenyellow;
    }
    .hljs-attribute {
        color: #eab700;
    }
    .hljs-number{
        color: #f5871f;
    }
    .hljs-keyword{
        color: #cf20ff;
    }
</style>